﻿namespace Main.lib.scene
{

    /*
     * Scene
     * 
     * @brief   Scene controller
     * @version 2011.11.14
     * 
     * @author  Bruno Miguel de Oliveira Tamer <bmotamer@gmail.com>
     */
    public abstract class Scene
    {
        
        private static Scene_Base Current; //!< Current game's scene

        /*
         * Change the current scene
         * 
         * @param (Scene_Base) NewScene - The next scene
         */
        public static void Set(Scene_Base NewScene)
        {
            if (Current != null)
                Current.Terminate();
            Current = NewScene;
            if (Current != null)
                Current.Start();
        }

        /*
         * Update the current scene
         * 
         * @return (bool) - If the current scene isn't null
         */
        public static bool Update()
        {
            if (Current == null)
                return false;
            Current.Update();
            return true;
        }

    }

}